package com.yuyou.fn.timer.task;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHander;
import com.xxl.job.core.log.XxlJobLogger;
import com.yuyou.fn.common.util.Utils;
import com.yuyou.fn.crm.service.IVisitMonitorService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@JobHander(value="CrmVisitMonitorTask")
@Component
public class CrmVisitMonitorTask extends IJobHandler {

    @Resource
    private IVisitMonitorService visitMonitorService;

    @Override
    public ReturnT<String> execute(String... params) throws Exception {
        try{
            visitMonitorService.monitorScan();
        }catch (Exception e){
            XxlJobLogger.log(Utils.getExceptionStackTrace(e));
            return  ReturnT.FAIL;
        }
        return  ReturnT.SUCCESS;
    }


}
